<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
	String path = "http://" + request.getServerName() + ":"
			+ request.getServerPort() + request.getContextPath();

	application.setAttribute("$path", path);
	application.setAttribute("$res_path", path);
	application
			.setAttribute("$res_path_resources", path + "/resources");
	application.setAttribute("$jsp_path", "/WEB-INF/jsp");
	application.setAttribute("$resouce_module_path", path
			+ "/resources/module");

	application.setAttribute("$version_javascript",
			System.currentTimeMillis());
	application
			.setAttribute("$version_css", System.currentTimeMillis());

	String theme = "def", themeCss = "";
	Cookie[] cookies = request.getCookies();
	if (cookies != null) {
		for (int i = 0; i < cookies.length; i++) {
			Cookie ki = cookies[i];
			if (ki != null) {
				if ("theme".equals(ki.getName())) {
					theme = ki.getValue();
				}
			}
		}
	}

	if ("gray".equals(theme)) {
		themeCss = "<link id='ext-css' rel='stylesheet' type='text/css' href='"
				+ path
				+ "/resources/extjs3.4/resources/css/xtheme-gray.css' />";
	} else {
		themeCss = "";
	}

	request.setAttribute("$theme", theme);
	request.setAttribute("$cur_theme", themeCss);
%>

<script type="text/javascript">
	var $res_path = "${$res_path}";
	var $res_path_resources = "${$res_path_resources}";
	var $path = "${$path}";
	var $User = {
		userId : "${sessionScope.$userId}"
	};
	var $theme = {
		def : "${$res_path_resources}/extjs3.4/resources/css/ext-all.css?v=${$version_css}",
		gray : "${$res_path_resources}/extjs3.4/resources/css/xtheme-gray.css?v=${$version_css}"
	};
</script>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
